Integrand size = 43, antiderivative size = 250 \[ \int \cos ^{\frac {9}{2}}(c+d x) (a+b \sec (c+d x))^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {2 \left (18 a b B+3 b^2 (3 A+5 C)+a^2 (7 A+9 C)\right ) E\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{15 d}+\frac {2 \left (10 a A b+5 a^2 B+7 b^2 B+14 a b C\right ) \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),2\right )}{21 d}+\frac {2 \left (10 a A b+5 a^2 B+7 b^2 B+14 a b C\right ) \sqrt {\cos (c+d x)} \sin (c+d x)}{21 d}+\frac {2 \left (4 A b^2+18 a b B+a^2 (7 A+9 C)\right ) \cos ^{\frac {3}{2}}(c+d x) \sin (c+d x)}{45 d}+\frac {2 a (4 A b+9 a B) \cos ^{\frac {5}{2}}(c+d x) \sin (c+d x)}{63 d}+\frac {2 A \cos ^{\frac {3}{2}}(c+d x) (b+a \cos (c+d x))^2 \sin (c+d x)}{9 d} \]
[Out]
Time = 0.67 (sec) , antiderivative size = 250, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.186, Rules used = {4197, 3128, 3112, 3102, 2827, 2719, 2715, 2720} \[ \int \cos ^{\frac {9}{2}}(c+d x) (a+b \sec (c+d x))^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {2 \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),2\right ) \left (5 a^2 B+10 a A b+14 a b C+7 b^2 B\right )}{21 d}+\frac {2 E\left (\left .\frac {1}{2} (c+d x)\right |2\right ) \left (a^2 (7 A+9 C)+18 a b B+3 b^2 (3 A+5 C)\right )}{15 d}+\frac {2 \sin (c+d x) \cos ^{\frac {3}{2}}(c+d x) \left (a^2 (7 A+9 C)+18 a b B+4 A b^2\right )}{45 d}+\frac {2 \sin (c+d x) \sqrt {\cos (c+d x)} \left (5 a^2 B+10 a A b+14 a b C+7 b^2 B\right )}{21 d}+\frac {2 a (9 a B+4 A b) \sin (c+d x) \cos ^{\frac {5}{2}}(c+d x)}{63 d}+\frac {2 A \sin (c+d x) \cos ^{\frac {3}{2}}(c+d x) (a \cos (c+d x)+b)^2}{9 d} \]
[In]
[Out]
Rule 2715
Rule 2719
Rule 2720
Rule 2827
Rule 3102
Rule 3112
Rule 3128
Rule 4197
Rubi steps \begin{align*} \text {integral}& = \int \sqrt {\cos (c+d x)} (b+a \cos (c+d x))^2 \left (C+B \cos (c+d x)+A \cos ^2(c+d x)\right ) \, dx \\ & = \frac {2 A \cos ^{\frac {3}{2}}(c+d x) (b+a \cos (c+d x))^2 \sin (c+d x)}{9 d}+\frac {2}{9} \int \sqrt {\cos (c+d x)} (b+a \cos (c+d x)) \left (\frac {3}{2} b (A+3 C)+\frac {1}{2} (7 a A+9 b B+9 a C) \cos (c+d x)+\frac {1}{2} (4 A b+9 a B) \cos ^2(c+d x)\right ) \, dx \\ & = \frac {2 a (4 A b+9 a B) \cos ^{\frac {5}{2}}(c+d x) \sin (c+d x)}{63 d}+\frac {2 A \cos ^{\frac {3}{2}}(c+d x) (b+a \cos (c+d x))^2 \sin (c+d x)}{9 d}+\frac {4}{63} \int \sqrt {\cos (c+d x)} \left (\frac {21}{4} b^2 (A+3 C)+\frac {9}{4} \left (10 a A b+5 a^2 B+7 b^2 B+14 a b C\right ) \cos (c+d x)+\frac {7}{4} \left (4 A b^2+18 a b B+a^2 (7 A+9 C)\right ) \cos ^2(c+d x)\right ) \, dx \\ & = \frac {2 \left (4 A b^2+18 a b B+a^2 (7 A+9 C)\right ) \cos ^{\frac {3}{2}}(c+d x) \sin (c+d x)}{45 d}+\frac {2 a (4 A b+9 a B) \cos ^{\frac {5}{2}}(c+d x) \sin (c+d x)}{63 d}+\frac {2 A \cos ^{\frac {3}{2}}(c+d x) (b+a \cos (c+d x))^2 \sin (c+d x)}{9 d}+\frac {8}{315} \int \sqrt {\cos (c+d x)} \left (\frac {21}{8} \left (18 a b B+3 b^2 (3 A+5 C)+a^2 (7 A+9 C)\right )+\frac {45}{8} \left (10 a A b+5 a^2 B+7 b^2 B+14 a b C\right ) \cos (c+d x)\right ) \, dx \\ & = \frac {2 \left (4 A b^2+18 a b B+a^2 (7 A+9 C)\right ) \cos ^{\frac {3}{2}}(c+d x) \sin (c+d x)}{45 d}+\frac {2 a (4 A b+9 a B) \cos ^{\frac {5}{2}}(c+d x) \sin (c+d x)}{63 d}+\frac {2 A \cos ^{\frac {3}{2}}(c+d x) (b+a \cos (c+d x))^2 \sin (c+d x)}{9 d}+\frac {1}{7} \left (10 a A b+5 a^2 B+7 b^2 B+14 a b C\right ) \int \cos ^{\frac {3}{2}}(c+d x) \, dx+\frac {1}{15} \left (18 a b B+3 b^2 (3 A+5 C)+a^2 (7 A+9 C)\right ) \int \sqrt {\cos (c+d x)} \, dx \\ & = \frac {2 \left (18 a b B+3 b^2 (3 A+5 C)+a^2 (7 A+9 C)\right ) E\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{15 d}+\frac {2 \left (10 a A b+5 a^2 B+7 b^2 B+14 a b C\right ) \sqrt {\cos (c+d x)} \sin (c+d x)}{21 d}+\frac {2 \left (4 A b^2+18 a b B+a^2 (7 A+9 C)\right ) \cos ^{\frac {3}{2}}(c+d x) \sin (c+d x)}{45 d}+\frac {2 a (4 A b+9 a B) \cos ^{\frac {5}{2}}(c+d x) \sin (c+d x)}{63 d}+\frac {2 A \cos ^{\frac {3}{2}}(c+d x) (b+a \cos (c+d x))^2 \sin (c+d x)}{9 d}+\frac {1}{21} \left (10 a A b+5 a^2 B+7 b^2 B+14 a b C\right ) \int \frac {1}{\sqrt {\cos (c+d x)}} \, dx \\ & = \frac {2 \left (18 a b B+3 b^2 (3 A+5 C)+a^2 (7 A+9 C)\right ) E\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{15 d}+\frac {2 \left (10 a A b+5 a^2 B+7 b^2 B+14 a b C\right ) \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),2\right )}{21 d}+\frac {2 \left (10 a A b+5 a^2 B+7 b^2 B+14 a b C\right ) \sqrt {\cos (c+d x)} \sin (c+d x)}{21 d}+\frac {2 \left (4 A b^2+18 a b B+a^2 (7 A+9 C)\right ) \cos ^{\frac {3}{2}}(c+d x) \sin (c+d x)}{45 d}+\frac {2 a (4 A b+9 a B) \cos ^{\frac {5}{2}}(c+d x) \sin (c+d x)}{63 d}+\frac {2 A \cos ^{\frac {3}{2}}(c+d x) (b+a \cos (c+d x))^2 \sin (c+d x)}{9 d} \\ \end{align*}
Time = 3.89 (sec) , antiderivative size = 194, normalized size of antiderivative = 0.78 \[ \int \cos ^{\frac {9}{2}}(c+d x) (a+b \sec (c+d x))^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {84 \left (18 a b B+3 b^2 (3 A+5 C)+a^2 (7 A+9 C)\right ) E\left (\left .\frac {1}{2} (c+d x)\right |2\right )+60 \left (5 a^2 B+7 b^2 B+2 a b (5 A+7 C)\right ) \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),2\right )+\sqrt {\cos (c+d x)} \left (7 \left (36 A b^2+72 a b B+a^2 (43 A+36 C)\right ) \cos (c+d x)+5 \left (156 a A b+78 a^2 B+84 b^2 B+168 a b C+18 a (2 A b+a B) \cos (2 (c+d x))+7 a^2 A \cos (3 (c+d x))\right )\right ) \sin (c+d x)}{630 d} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. \(783\) vs. \(2(282)=564\).
Time = 433.44 (sec) , antiderivative size = 784, normalized size of antiderivative = 3.14
[In]
[Out]
Result contains higher order function than in optimal. Order 9 vs. order 4.
Time = 0.14 (sec) , antiderivative size = 318, normalized size of antiderivative = 1.27 \[ \int \cos ^{\frac {9}{2}}(c+d x) (a+b \sec (c+d x))^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {2 \, {\left (35 \, A a^{2} \cos \left (d x + c\right )^{3} + 75 \, B a^{2} + 30 \, {\left (5 \, A + 7 \, C\right )} a b + 105 \, B b^{2} + 45 \, {\left (B a^{2} + 2 \, A a b\right )} \cos \left (d x + c\right )^{2} + 7 \, {\left ({\left (7 \, A + 9 \, C\right )} a^{2} + 18 \, B a b + 9 \, A b^{2}\right )} \cos \left (d x + c\right )\right )} \sqrt {\cos \left (d x + c\right )} \sin \left (d x + c\right ) - 15 \, \sqrt {2} {\left (5 i \, B a^{2} + 2 i \, {\left (5 \, A + 7 \, C\right )} a b + 7 i \, B b^{2}\right )} {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) + i \, \sin \left (d x + c\right )\right ) - 15 \, \sqrt {2} {\left (-5 i \, B a^{2} - 2 i \, {\left (5 \, A + 7 \, C\right )} a b - 7 i \, B b^{2}\right )} {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) - i \, \sin \left (d x + c\right )\right ) - 21 \, \sqrt {2} {\left (-i \, {\left (7 \, A + 9 \, C\right )} a^{2} - 18 i \, B a b - 3 i \, {\left (3 \, A + 5 \, C\right )} b^{2}\right )} {\rm weierstrassZeta}\left (-4, 0, {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) + i \, \sin \left (d x + c\right )\right )\right ) - 21 \, \sqrt {2} {\left (i \, {\left (7 \, A + 9 \, C\right )} a^{2} + 18 i \, B a b + 3 i \, {\left (3 \, A + 5 \, C\right )} b^{2}\right )} {\rm weierstrassZeta}\left (-4, 0, {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) - i \, \sin \left (d x + c\right )\right )\right )}{315 \, d} \]
[In]
[Out]
Timed out. \[ \int \cos ^{\frac {9}{2}}(c+d x) (a+b \sec (c+d x))^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\text {Timed out} \]
[In]
[Out]
Timed out. \[ \int \cos ^{\frac {9}{2}}(c+d x) (a+b \sec (c+d x))^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\text {Timed out} \]
[In]
[Out]
\[ \int \cos ^{\frac {9}{2}}(c+d x) (a+b \sec (c+d x))^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\int { {\left (C \sec \left (d x + c\right )^{2} + B \sec \left (d x + c\right ) + A\right )} {\left (b \sec \left (d x + c\right ) + a\right )}^{2} \cos \left (d x + c\right )^{\frac {9}{2}} \,d x } \]
[In]
[Out]
Time = 19.83 (sec) , antiderivative size = 366, normalized size of antiderivative = 1.46 \[ \int \cos ^{\frac {9}{2}}(c+d x) (a+b \sec (c+d x))^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {2\,B\,b^2\,\left (\sqrt {\cos \left (c+d\,x\right )}\,\sin \left (c+d\,x\right )+\mathrm {F}\left (\frac {c}{2}+\frac {d\,x}{2}\middle |2\right )\right )}{3\,d}+\frac {2\,C\,b^2\,\mathrm {E}\left (\frac {c}{2}+\frac {d\,x}{2}\middle |2\right )}{d}+\frac {2\,C\,a\,b\,\left (\frac {2\,\sqrt {\cos \left (c+d\,x\right )}\,\sin \left (c+d\,x\right )}{3}+\frac {2\,\mathrm {F}\left (\frac {c}{2}+\frac {d\,x}{2}\middle |2\right )}{3}\right )}{d}-\frac {2\,A\,a^2\,{\cos \left (c+d\,x\right )}^{11/2}\,\sin \left (c+d\,x\right )\,{{}}_2{\mathrm {F}}_1\left (\frac {1}{2},\frac {11}{4};\ \frac {15}{4};\ {\cos \left (c+d\,x\right )}^2\right )}{11\,d\,\sqrt {{\sin \left (c+d\,x\right )}^2}}-\frac {2\,A\,b^2\,{\cos \left (c+d\,x\right )}^{7/2}\,\sin \left (c+d\,x\right )\,{{}}_2{\mathrm {F}}_1\left (\frac {1}{2},\frac {7}{4};\ \frac {11}{4};\ {\cos \left (c+d\,x\right )}^2\right )}{7\,d\,\sqrt {{\sin \left (c+d\,x\right )}^2}}-\frac {2\,B\,a^2\,{\cos \left (c+d\,x\right )}^{9/2}\,\sin \left (c+d\,x\right )\,{{}}_2{\mathrm {F}}_1\left (\frac {1}{2},\frac {9}{4};\ \frac {13}{4};\ {\cos \left (c+d\,x\right )}^2\right )}{9\,d\,\sqrt {{\sin \left (c+d\,x\right )}^2}}-\frac {2\,C\,a^2\,{\cos \left (c+d\,x\right )}^{7/2}\,\sin \left (c+d\,x\right )\,{{}}_2{\mathrm {F}}_1\left (\frac {1}{2},\frac {7}{4};\ \frac {11}{4};\ {\cos \left (c+d\,x\right )}^2\right )}{7\,d\,\sqrt {{\sin \left (c+d\,x\right )}^2}}-\frac {4\,A\,a\,b\,{\cos \left (c+d\,x\right )}^{9/2}\,\sin \left (c+d\,x\right )\,{{}}_2{\mathrm {F}}_1\left (\frac {1}{2},\frac {9}{4};\ \frac {13}{4};\ {\cos \left (c+d\,x\right )}^2\right )}{9\,d\,\sqrt {{\sin \left (c+d\,x\right )}^2}}-\frac {4\,B\,a\,b\,{\cos \left (c+d\,x\right )}^{7/2}\,\sin \left (c+d\,x\right )\,{{}}_2{\mathrm {F}}_1\left (\frac {1}{2},\frac {7}{4};\ \frac {11}{4};\ {\cos \left (c+d\,x\right )}^2\right )}{7\,d\,\sqrt {{\sin \left (c+d\,x\right )}^2}} \]
[In]
[Out]